﻿<%@ Page Title="Reports" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Reports.aspx.cs" Inherits="ColorApplication.color.Reports" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="adminContent">
        <h2>Reports</h2>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
                <div id="modalPage" runat="server" class="modalPage">
                    <div class="modalBackground">
                    </div>
                    <div class="modalContainer">
                        <div class="modal">
                            <table>
                                <tr>
                                    <td align="center">
                                        <div style="background-color: White; border-radius: 5px; color: black; height: 47px;
                                            padding-top: 5px;">
                                            Please Wait...
                                        <br />
                                            <img src="../Images/preloader.gif" />
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Label ID="ErrorLabel" runat="server" CssClass="failureNotification"></asp:Label>
                <table style="border: solid 1px; width: 890px;">
                    <tr>
                        <td colspan="4" style="text-align: left;">
                            <table>
                                <tr>
                                    <td >Start Date:</td>
                                    <td>
                                        <asp:TextBox ID="StartDateTextBox" runat="server" ValidationGroup="Compare"></asp:TextBox>
                                        <asp:CalendarExtender ID="StartDateTextBox_CalendarExtender" runat="server" Enabled="True"
                                            Format="dd-MM-yyyy" TargetControlID="StartDateTextBox">
                                        </asp:CalendarExtender>
                                    </td>
                                    <td>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="StartDateTextBox"
                                            ErrorMessage="Enter Valid Date" ForeColor="Red" SetFocusOnError="True" ValidationExpression="^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$"
                                            ValidationGroup="Compare" Display="Dynamic">Enter Valid Date</asp:RegularExpressionValidator>
                                    </td>
                                    <td align="left">End Date:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="EndDateTextBox" runat="server" ValidationGroup="Compare"></asp:TextBox>
                                        <asp:CalendarExtender ID="EndDateTextBox_CalendarExtender" runat="server" Enabled="True"
                                            Format="dd-MM-yyyy" TargetControlID="EndDateTextBox">
                                        </asp:CalendarExtender>
                                    </td>
                                    <td>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="EndDateTextBox"
                                            ErrorMessage="Enter Valid Date" ForeColor="Red" SetFocusOnError="True" ValidationExpression="^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$"
                                            ValidationGroup="Compare" Display="Dynamic">Enter Valid Date</asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; width: 300px;" colspan="4" >
                            <table>
                                <tr>
                                    <td>
                                        Selected Option:
                                        <asp:DropDownList ID="ddlSelectedOption" runat="server" Style="background-color: #E1E1E1; border: 1px solid #B6B6B6; width: 150px;"
                                            AutoPostBack="True" OnSelectedIndexChanged="OptionChanged">
                                            <asp:ListItem Text="All" Value="0" />
                                            <asp:ListItem Text="One picture" Value="1" />
                                            <asp:ListItem Text="Two picture" Value="2" />
                                            <asp:ListItem Text="URL" Value="3" />
                                        </asp:DropDownList>&nbsp;&nbsp;
                                    </td>
                                    <td>
                                        <asp:Panel runat="server" ID="pnlSelectUrl" Visible="False">
                                            <table>
                                                <tr>
                                                    <td>
                                                        Select URL:&nbsp;
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlSelectUrl" runat="server"
                                                            Style="background-color: #E1E1E1; border: 1px solid #B6B6B6; width: 150px;"></asp:DropDownList>
                                                        This select will be ignored if you enter the text box below.
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Enter a URL:&nbsp;
                                                    </td>
                                                    <td>
                                                        <asp:TextBox runat="server" ID="txtSelectUrl" Width="300"></asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left;" colspan="4">
                            Attribute family:
                            <asp:DropDownList ID="ddlAttrsFamily" runat="server" Style="background-color: #E1E1E1; border: 1px solid #B6B6B6;" >
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="text-align: left"> 
                            <input type="button" onclick="colorsay.OpenNewWindowForReport('<%= ReportCacheKey %>');" value="Show Report" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <%--<Triggers>
                <asp:PostBackTrigger ControlID="ExportButton" />
            </Triggers>--%>
        </asp:UpdatePanel>
    </div>
    
<script type="text/javascript">
    $(function () {
        var sd = colorsay.GetQueryStringValueByName("sd", "");
        var ed = colorsay.GetQueryStringValueByName("ed", "");
        var so = colorsay.GetQueryStringValueByName("so", "");
        var af = colorsay.GetQueryStringValueByName("af", "");

        $("input[id$='StartDateTextBox']").val(sd);
        $("input[id$='EndDateTextBox']").val(ed);
        $("select[id$='ddlSelectedOption']").val(so);
        $("select[id$='ddlAttrsFamily']").val(af);
    });
</script>
</asp:Content>
